import request from '@/config/axios'

// 供应商支付记录 VO
export interface SupplierMoneyVO {
  id: number // 唯一ID
  supplierId: number // 供应商ID
  moneyAll: number // 总金额
  moneyMy: number // 结算金额
  moneyTime: Date // 结算时间(年-月）
  state: number // 状态：0未结算 1已结算
  settleAccountsTime: Date // 结算时间
  img: string // 结算凭证
}

// 供应商支付记录 API
export const SupplierMoneyApi = {
  // 查询供应商支付记录分页
  getSupplierMoneyPage: async (params: any) => {
    return await request.get({ url: `/dlbz/supplier-money/page`, params })
  },

  // 查询供应商支付记录详情
  getSupplierMoney: async (id: number) => {
    return await request.get({ url: `/dlbz/supplier-money/get?id=` + id })
  },

  // 新增供应商支付记录
  createSupplierMoney: async (data: SupplierMoneyVO) => {
    return await request.post({ url: `/dlbz/supplier-money/create`, data })
  },

  // 修改供应商支付记录
  updateSupplierMoney: async (data: SupplierMoneyVO) => {
    return await request.put({ url: `/dlbz/supplier-money/update`, data })
  },

  // 删除供应商支付记录
  deleteSupplierMoney: async (id: number) => {
    return await request.delete({ url: `/dlbz/supplier-money/delete?id=` + id })
  },

  // 导出供应商支付记录 Excel
  exportSupplierMoney: async (params) => {
    return await request.download({ url: `/dlbz/supplier-money/export-excel`, params })
  }
}